#include <Bitmap.hpp>

int main(int argc, const char **argv) {
  uint32_t width = 256;
  uint32_t height = 256;

  Bitmap bitmap(width, height);

  for (uint32_t i = 0; i < bitmap.Width(); i++) {
    for (uint32_t j = 0; j < bitmap.Height(); j++) {
      double r = double(j) / (width - 1);
      double g = double(i) / (height - 1);
      double b = 0.25;

      auto ir = static_cast<uint8_t>(255.999 * r);
      auto ig = static_cast<uint8_t>(255.999 * g);
      auto ib = static_cast<uint8_t>(255.999 * b);

      bitmap.setPixel(i, j, Bitmap::Pixel{ir, ig, ib});
    }
  }

  bitmap.writeToFile("hello_world.png");

  return 0;
}